﻿{extend name="base" /}

{block name="body"}

<!-- Main Container  -->
<div class="main-container container">
	<ul class="breadcrumb">
		<li><a href="{:url('home/index/index')}"><i class="fa fa-home"></i></a></li>
		<li><a href="#">商品列表</a></li>
	</ul>

	<div class="row">
		<!--Left Part Start -->
		<aside class="col-sm-4 col-md-3" id="column-left">

			<div class="module latest-product titleLine">
				<h3 class="modtitle">推荐热卖</h3>
				<div class="modcontent ">
					<div class="product-latest-item">
						<div class="media">
							<div class="media-left">
								<a href="__TEMPLATE__/#"><img src="__TEMPLATE__/image/demo/shop/product/m1.jpg" alt="Cisi Chicken" title="Cisi Chicken" class="img-responsive" style="width: 100px; height: 82px;"></a>
							</div>
							<div class="media-body">
								<div class="caption">
									<h4><a href="__TEMPLATE__/#">Sunt Molup</a></h4>

									<div class="price">
										<span class="price-new">$100.00</span>
									</div>
									<div class="ratings">
										<div class="rating-box">
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="product-latest-item">
						<div class="media">
							<div class="media-left">
								<a href="__TEMPLATE__/#"><img src="__TEMPLATE__/image/demo/shop/product/m2.jpg" alt="Cisi Chicken" title="Cisi Chicken" class="img-responsive" style="width: 100px; height: 82px;"></a>
							</div>
							<div class="media-body">
								<div class="caption">
									<h4><a href="__TEMPLATE__/#">Et Spare</a></h4>

									<div class="price">
										<span class="price-new">$99.00</span>
									</div>
									<div class="ratings">
										<div class="rating-box">
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="product-latest-item">
						<div class="media">
							<div class="media-left">
								<a href="__TEMPLATE__/#"><img src="__TEMPLATE__/image/demo/shop/product/18.jpg" alt="Cisi Chicken" title="Cisi Chicken" class="img-responsive" style="width: 100px; height: 82px;"></a>
							</div>
							<div class="media-body">
								<div class="caption">
									<h4><a href="__TEMPLATE__/#">Cisi Chicken</a></h4>

									<div class="price">
										<span class="price-new">$59.00</span>
									</div>
									<div class="ratings">
										<div class="rating-box">
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="product-latest-item transition">
						<div class="media">
							<div class="media-left">
								<a href="__TEMPLATE__/#"><img src="__TEMPLATE__/image/demo/shop/product/9.jpg" alt="Cisi Chicken" title="Cisi Chicken" class="img-responsive" style="width: 100px; height:82px;"></a>
							</div>
							<div class="media-body">
								<div class="caption">
									<h4><a href="__TEMPLATE__/#">Kevin Labor</a></h4>
									<div class="price">
										<span class="price-new">$245.00</span>
									</div>
									<div class="ratings">
										<div class="rating-box">
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
											<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>


				</div>

			</div>
			<div class="module">
				<div class="modcontent clearfix">
					<div class="banners">
						<div>
							<a href="__TEMPLATE__/#"><img src="__TEMPLATE__/image/demo/cms/left-image-static.png" alt="left-image"></a>
						</div>
					</div>

				</div>
			</div>
		</aside>
		<!--Left Part End -->

		<!--Middle Part Start-->
		<div id="content" class="col-md-9 col-sm-8">
			<div class="products-category">
				<div class="category-derc">
					<div class="row">
						<div class="col-sm-12">
							<h3 class="modtitle"><strong>搜索条件</strong></h3>
							<table class="table table-bordered">

								{if condition="$brandData"}
								<tr>
									<td class="active" width="10%"><strong>品牌</strong></td>
								    <td>
								    	{php}
								    		if (!$brand_id OR $brand_id == 'all') {
												$brand_status = true;
								    		} else {
								    			$brand_status = false;
								    		}
								    	{/php}
								    	<a class="btn btn-{$brand_status ? 'warning' : 'default'}" href="{:url('home/Search/index',['brand_id'=>'all','searchData'=>$searchData])}">不限</a>
										{volist name="$brandData" id="v3"}
										<a class="btn btn-{$brand_id == $v3.id ? 'warning' : 'default'}" href="{:url('home/Search/index',['brand_id'=>$v3.id,'searchData'=>$searchData])}" title="{$v3.brand_name}"><img src={$v3.brand_logo|show_image="goods_brand",###} alt="{$v3.brand_name}" class="img-thumbnail" width="60" ></a>
										{/volist}
								    </td>
								</tr>
								{/if}

								{if condition="$priceData"}
								<tr>
									<td class="active" width="10%"><strong>价格区间</strong></td>
								    <td>
						    	    	{php}
						    	    		if (!$search_price OR $search_price == 'all') {
						    					$price_status = true;
						    	    		} else {
						    	    			$price_status = false;
						    	    		}
						    	    	{/php}
								    	<a class="btn btn-{$price_status ? 'warning' : 'default'}" href="{:url('home/Search/index',['search_price'=>'all','searchData'=>$searchData])}" title="{$v3.brand_name}">不限</a>
										{volist name="$priceData" id="v2"}
										<a class="btn btn-{$search_price == $v2 ? 'warning' : 'default'}" href="{:url('home/Search/index',['search_price'=>$v2,'searchData'=>$searchData])}">{$v2}</a>
										{/volist}
								    </td>
								</tr>
								{/if}

								<!-- 属性搜索 -->
								{volist name="attrData" id="v" key="k" }
								 <tr>
								 	<td class="active" width="10%"><strong>{$v.attr_name}</strong></td>
								    <td>
								    	{php}
								    		// 制作不限按钮超链接
								    		$_tmp_attr_arr = $_attr_arr;
								    		$_tmp_attr_arr[$k-1] = 'all';
								    		$_tmp_attr_str = implode('.', $_tmp_attr_arr);

											// 根据传入的状态确定不限按钮的显示样式
								    		if ($_attr_arr[$k-1] == 'all') {
												$attr_status = true;
								    		} else {
								    			$attr_status = false;
								    		}
								    	{/php}
								    	<a class="btn btn-{$attr_status ? 'warning' : 'default'}" href="{:url('home/Search/index',['search_attr' => $_tmp_attr_str,'searchData'=>$searchData])}" >不限</a>&nbsp;&nbsp;&nbsp;&nbsp;
										{volist name="$v.attr_value" id="v1" key="k1" }
										{php}
											// 制作当前按钮超链接
											$_tmp_attr_arr = $_attr_arr;
											$_tmp_attr_arr[$k-1] = trim($v1['value']).'-'.$v['id'];
											$_tmp_attr_str = implode('.', $_tmp_attr_arr);

											// 根据传入的状态确定当前按钮的显示样式
											if( $_attr_arr[$k-1] == $_tmp_attr_arr[$k-1] ) {
												$attr_this_status = true;
											} else {
												$attr_this_status = false;
											}
										{/php}
										<a class="btn btn-{$attr_this_status ? 'warning' : 'default'}" href="{:url('home/Search/index',['search_attr' => $_tmp_attr_str,'searchData'=>$searchData])}">{$v1.value}</a>
										{/volist}
								    </td>
								 </tr>
								 {/volist}

							</table>

						</div>
					</div>
				</div>
				<!-- Filters -->
				<div class="product-filter filters-panel">
					<div class="row">
						<div class="col-md-2 visible-lg">
							<div class="view-mode">
								<div class="list-view">
									<button class="btn btn-default grid active" data-view="grid" data-toggle="tooltip"  data-original-title="Grid"><i class="fa fa-th"></i></button>
									<button class="btn btn-default list" data-view="list" data-toggle="tooltip" data-original-title="List"><i class="fa fa-th-list"></i></button>
								</div>
							</div>
						</div>

						<div class="col-md-6 visible-lg">
							<div class="view-mode">
								<div class="list-view">
									<a class="btn btn-{$sort == 'now_price' ? 'warning' : 'default'}" href="{:url('home/Search/index',['sort'=>'now_price','searchData'=>$searchData])}">价格 <i class="fa fa-long-arrow-up"></i></a>
									<a class="btn btn-{$sort == 'now_price_d' ? 'warning' : 'default'}" href="{:url('home/Search/index',['sort'=>'now_price_d','searchData'=>$searchData])}">价格 <i class="fa fa-long-arrow-down"></i></a>
									<a class="btn btn-{$sort == 'create_time_d' ? 'warning' : 'default'}" href="{:url('home/Search/index',['sort'=>'create_time_d','searchData'=>$searchData])}">人气</a>
									<a class="btn btn-{$sort == 'create_time_d' ? 'warning' : 'default'}" href="{:url('home/Search/index',['sort'=>'create_time_d','searchData'=>$searchData])}">最新发布</a>
								</div>
							</div>
						</div>

				</div>
			</div>
			<!-- //end Filters -->
			<!--changed listings-->
			<div class="products-list row grid">

			{if condition="$goodsInfo->total() != 0"}
				{volist name="goodsInfo" id="v"}
				<div class="product-layout col-md-4 col-sm-6 col-xs-12 ">
					<div class="product-item-container">
						<div class="left-block">
							<div class="product-image-container lazy second_img ">
								<img data-src="{$v.goods_image|show_image="goods",###}" src=""  alt="Apple Cinema 30&quot;" class="img-responsive" />
								<img data-src="{$v.goods_image|show_image="goods",###}" src=""  alt="Apple Cinema 30&quot;" class="img_0 img-responsive" />
							</div>

							<a class="quickview  visible-lg" data-fancybox-type="iframe"  href="{:url('home/Goods/goodsDetails',array('id'=>$v.id))}" target="_blank">  点击查看</a>
						</div>

						<div class="right-block">
							<div class="caption">
								<h4><a href="{:url('home/Goods/goodsDetails',array('id'=>$v.id))}" target="_blank">{$v.goods_name}</a></h4>

								<div class="price">
									<span class="price-new">${$v.now_price}</span> 
									<span class="price-old">${$v.original_price}</span>
								</div>
								<div class="description item-desc hidden">
									{$v.goods_brief}
								</div>
							</div>

						</div>

					</div>
				</div>

				<div class="clearfix visible-sm-block"></div>
				<div class="clearfix visible-xs-block"></div>
				{/volist}
			{else/}
				<div>
					<h2>没有任何商品</h2>
				</div>
			{/if}


			</div>
			<!--// End Changed listings-->


			<!-- Filters -->
			<div class="product-filter product-filter-bottom filters-panel" >
				<div class="row">
					{$goodsInfo->render()}
				</div>
			</div>
			<!-- //end Filters -->

		</div>

	</div>


</div>
<!--Middle Part End-->
</div>
<!-- //Main Container -->



{/block}

{block name="script"}
	<script type="text/javascript" src="__HJS__/search/index.js"></script>
{/block}